package com.product.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaCheckRole;
import cn.dev33.satoken.annotation.SaMode;
import com.common.R;
import com.product.controller.vo.ProductByPageVo;
import com.product.controller.vo.editEquityVo;
import com.product.controller.vo.equityVo;
import com.product.service.IProductEquity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

/**
 * @program: Member_Perks_Store
 * @description:
 * @author: 无恙
 * @create: 2024-06-18 21:32
 **/

@RestController
@RequestMapping("/product")
public class equityController {

    @Autowired
    private IProductEquity productEquity;


    /*
    * @author 范铁凝
    * @date 2024/6/18
    * 新建商品
    */
    @SaCheckPermission("product:add")
    @PostMapping("/add")
    public R<Object> addEquity( @RequestBody equityVo equityVo) {
        System.out.println(equityVo);
        return productEquity.addEquity(equityVo) ? R.data(true):R.fail("商品上架失败");
    }






}
